\documentclass[11pt,letterpaper,english]{scrbook}
\usepackage{mathptmx}
\usepackage{helvet}
\usepackage{courier}
\usepackage[T1]{fontenc}
%\usepackage{CJK}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage{array}
\usepackage{varioref}
\renewcommand*{\reftextfaraway}[1]{位于~\pageref{#1}页}
%\renewcommand\contentsname{目录}
%\renewcommand\listfigurename{索引}
\usepackage{float}
\usepackage{url}
\usepackage{amsmath}
\usepackage{makeidx}
\makeindex
\usepackage{graphicx}
\makeatletter % Changes control code settings - probably lyx inheritance. Closed by \makeatother below

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth
\providecommand{\LyX}{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\newenvironment{lyxcode}
{\par\begin{list}{}{
\setlength{\rightmargin}{\leftmargin}
\setlength{\listparindent}{0pt}% needed for AMS classes
\raggedright
\setlength{\itemsep}{0pt}
\setlength{\parsep}{0pt}
\normalfont\ttfamily}%
 \item[]}
{\end{list}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
% Include the proper LaTeX packages:
%----------------------------------------------------------------------------------------------------
\usepackage{graphicx}
\usepackage{titling}
\usepackage{ifthen}
\usepackage[absolute]{textpos}
\usepackage[colorlinks=true,
                       pagecolor=black,
                       menucolor=black,
                       linkcolor=black,
                       citecolor=blue,
                       pagebordercolor=1 1 1,
                       urlcolor=red,
                       plainpages=false,
                       pdfpagelabels=true,
                       unicode=true,
                       bookmarksnumbered=true]{hyperref}
\usepackage{lastpage}
\newcommand{\reportTopic}{<reportTopic>}
\newcommand{\revisionNumber}{<rev. no.>}
\newcommand{\TranslateRevisionNumber}{<rev.no.>}
\newcommand{\documentNumber}{<doc. no.>}


% Setup the right-hand header to display the current doc section:
%----------------------------------------------------------------------------------------------------
\renewcommand{\sectionmark}[1]{\markright{#1}}
\renewcommand{\subsectionmark}[1]{\markright{#1}}

% Setup for roman numeral page numbers until TOC:
%----------------------------------------------------------------------------------------------------
\newboolean{romanpn}
\pagenumbering{roman}
\setboolean{romanpn}{true}
\let\myTOC\tableofcontents
\renewcommand\tableofcontents{%
\myTOC
\clearpage
\pagenumbering{arabic}
\setboolean{romanpn}{false}
}

% Modify titlepage format:
%----------------------------------------------------------------------------------------------------
\setlength{\TPHorizModule}{1in}
\setlength{\TPVertModule}{\TPHorizModule}
\textblockorigin{3.25in}{1in}
\pretitle
 {
    \begin{flushright}\LARGE\sffamily 
    \thispagestyle{empty}
    \begin{textblock}{4}(0,0)
    \includegraphics[width=2in,keepaspectratio=true]{Layout/fossil.png}
    \end{textblock}
    \vspace{2in}
  }

\posttitle{\par\end{flushright}}
\preauthor{\begin{flushright} \large \sffamily \lineskip 0.5em 
\begin{tabular}[t]{c}}
\postauthor{\end{tabular} \par\end{flushright}}
%\predate{\begin{flushright}\large \sffamily Document Number: \documentNumber \\ Revision Number: \revisionNumber \\}

%\postdate{
%\vspace{2in}
%\\Pandora Products.
%\\215 Uschak Road
%\\Derry, PA  15627
%\par\end{flushright}}

% Setup "fancy" page layout:
%----------------------------------------------------------------------------------------------------
\fancyhf{}
\setlength{\topmargin}{-1in}
\setlength{\headheight}{1in}
\setlength{\headsep}{0.5in}
\setlength{\oddsidemargin}{0.25in}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\textwidth}{6in}
\setlength{\headwidth}{\textwidth}
\setlength{\textheight}{8.375in}
\setlength{\footskip}{0.5in}

% Setup header:
%------------------------------------------------------------------------------------------
\fancyhead[L]{\sffamily Fossil 版本控制}
\fancyhead[R]{\includegraphics[scale=0.3]{Layout/fossil.png}}

% Setup footer:
%------------------------------------------------------------------------------------------
\renewcommand{\footrulewidth}{0.4pt}

\fancyfoot[L]{\emph{ 基于Fossil版本1.25撰写 }}
%\fancyfoot[L]{\sffamily \bfseries \documentNumber \\ \mdseries Revision:  \revisionNumber}
%\fancyfoot[C]{\sffamily \bfseries\thedate \\ }
\fancyfoot[R]{\ifthenelse{\boolean{romanpn}}{\sffamily  \thepage}{\sffamily Page \thepage\ of \pageref{LastPage}}}

\makeatother
\usepackage{babel}
\usepackage{CJKutf8}
\usepackage{authblk}
\usepackage{indentfirst}
\setlength{\parindent}{2em}
\begin{document}
\begin{CJK}{UTF8}{gbsn}
\renewcommand{\documentNumber}{PAN-20100424}
\renewcommand{\reportTopic}{用户向导}
\renewcommand{\revisionNumber}{2.0}
\renewcommand{\TranslateRevisionNumber}{1.0}

\title{Fossil版本控制 \\ \reportTopic}
\author{ Jim Schimpf 著\\ lomatus 译}


\date{}

\maketitle
\thispagestyle{empty}

\newpage{}
\noindent 2010 Pandora Products.
 
\noindent 文章编号: \documentNumber{}

本文遵循署名-非商业性使用-相同方式共享3.0--CCASA 3.0， 您可以访问 \url{http://creativecommons.org/licenses/by-sa/3.0/us/}获得协议的详细内容，或者发送邮件到地址: 
171 Second Street, 
Suite 300, 
San Francisco, 
California, 94105, USA.索取该协议的副本。

\medskip{}
\noindent \textbf{联系作者：}
 
\noindent Pandora Products \\
215 Uschak Road \\
Derry, PA 15627 \\
United States of America

\medskip{}
\noindent 电话: 724.539.1276 \\
传真: 724.539.1276 \\
网站: http://www.fossil-scm.org/schimpf-book/index \\
邮箱: jim.schimpf@gmail.com \\

\medskip{}
\noindent \textbf{联系译者：}

\noindent 邮箱: lomatus@163.com \\

\noindent \textbf{当前版本:}

\noindent 版本号: \revisionNumber{}

\noindent 日期: 2012-11-29

\medskip{}
\noindent \textbf{翻译版本:}

\noindent 译文版本: \TranslateRevisionNumber{}

\noindent 日期: 2013-09-18

\tableofcontents{}

% ----------- Start of Document Content ------------------

\include{Chapters/foreword}

\mainmatter
\include{Chapters/introduction}
\include{Chapters/single_user}
\include{Chapters/multiple_user}
\include{Chapters/forks_branches}
\include{Chapters/commands}
\include{Chapters/th1_scripting}
\include{Chapters/whats_next}

\pagebreak{}

\printindex{}
\listoffigures

\bibliographystyle{plain}
\bibliography{Research/fossilbib}

\appendix

\include{Appendices/revision_history}

\end{CJK}
\end{document}
